# This code is part of the MWP System
# Copyright (c) 2012 Benjamin Lubin (blubin@bu.com) 
# Published under and subject to the GPLv2 license available at http://www.gnu.org/licenses/gpl-2.0.html

'''
Created on Dec 18, 2012
@author: blubin
Modified by Gian Calvesbert 1/7/2013
'''

from frontend.roleApplication import RoleApplication;
from frontend.form import Type;
from unique import UNIQUE

class ArtHistorianApplication(RoleApplication):
    """ The Art Historian User Interface """

    def __init__(self):
        super(ArtHistorianApplication, self).__init__("Gallery"+UNIQUE, "ArtHist");
        self.register_transition_step("WriteHistory", self.HistoryCreator, name_fields=["sequence", "PaintingName", "Date", "Style"]);
        self.register_sink_step("Location", self.DisplayCreator, name_fields=["sequence", "Location"]);


    def HistoryCreator(self, stepname, form):
        form.add_static_label("Please enter historical information of art piece")
        form.add_task_label(fields=["PaintingName"]);
        form.add_field(Type.SHORTSTRING, "Painter Name")
        form.add_field(Type.DATE, "Date")
        form.add_field(Type.SHORTSTRING, "Style")
        
    def DisplayCreator(self, stepname, form):
        form.add_static_label("Please enter where this piece will be located")
        form.add_task_label(fields=["PaintingName"]);
        form.add_field(Type.SHORTSTRING, "Location")
    
if __name__ == '__main__':
    app = ArtHistorianApplication();
    app.MainLoop();